home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-26 | 2.7 KB | 47 lines | [TEXT/MMCC] |
- //------------------------------------------------------------------------------
- // File: widget.h
- // Date: 7/8/94
- // Author: Bretton Wade
- //
- // Description: this file contains the class definition for a widget. a
- // widget is a user interface item that handles clicks and keys
- // and other forms of interaction.
- //
- //------------------------------------------------------------------------------
-
- #ifndef WIDGET
- #define WIDGET
-
- //------------------------------------------------------------------------------
- // classes
- //------------------------------------------------------------------------------
- class widget // user interface widget class
- { // begin
- private: // members internal to this class only
- protected: // members internal to this class hierarchy
- widget *next; // pointer to next widget in the list
- widget *children; // pointer to child widgets
- widget *parent; // pointer to parent widget
- bool enabled; // whether or not the widget is enabled
- public: // members available externally
- RgnHandle region; // the area that belongs to this widget
- widget (void); // constructor
- virtual ~widget (void); // destructor
- virtual widget *AdjustCursor (EventRecord&); // adjust the cursor appropriately
- virtual void SetCursor (void); // set the cursor to the correct shape
- virtual void HandleClick (EventRecord&); // handle mouse down/up
- virtual void HandleKey (EventRecord&); // handle key press events
- virtual void Update (EventRecord&); // update the widget and all of its children
- virtual void Activate (EventRecord&); // activate/deactivate the widget
- virtual void Resize (EventRecord&); // recompute sizing information from parent
- virtual void AddChild (widget*); // add a child widget to this one
- virtual widget *FindWidget (EventRecord&); // return a pointer to the widget that owns the location of the mouse
- virtual void Enable (bool); // set the enable state of the widget
- virtual void Action (int); // an action command
- virtual void Draw (void); // draw the widget
- }; // end
-
- //------------------------------------------------------------------------------
-
- #endif //WIDGET
-